/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ghanaroutes.entities;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author User
 */
@Entity
@Table(name = "blockedFriends")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "BlockedFriends.findAll", query = "SELECT b FROM BlockedFriends b"),
    @NamedQuery(name = "BlockedFriends.findByBlockedId", query = "SELECT b FROM BlockedFriends b WHERE b.blockedId = :blockedId"),
    @NamedQuery(name = "BlockedFriends.findByUserId", query = "SELECT b FROM BlockedFriends b WHERE b.userId = :userId"),
    @NamedQuery(name = "BlockedFriends.findByFriendId", query = "SELECT b FROM BlockedFriends b WHERE b.userId = :userId and b.friendId = :friendId"),
    @NamedQuery(name = "BlockedFriends.findByDateBlocked", query = "SELECT b FROM BlockedFriends b WHERE b.dateBlocked = :dateBlocked")})
public class BlockedFriends implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "blockedId")
    private Integer blockedId;
    @Column(name = "userId")
    private Integer userId;
    @Size(max = 50)
    @Column(name = "friendId")
    private String friendId;
    @Column(name = "dateBlocked")
    @Temporal(TemporalType.TIMESTAMP)
    private Date dateBlocked;

    public BlockedFriends() {
    }

    public BlockedFriends(Integer blockedId) {
        this.blockedId = blockedId;
    }

    public BlockedFriends(Integer blockedId, Date dateBlocked) {
        this.blockedId = blockedId;
        this.dateBlocked = dateBlocked;
    }

    public Integer getBlockedId() {
        return blockedId;
    }

    public void setBlockedId(Integer blockedId) {
        this.blockedId = blockedId;
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public String getFriendId() {
        return friendId;
    }

    public void setFriendId(String friendId) {
        this.friendId = friendId;
    }

    public Date getDateBlocked() {
        return dateBlocked;
    }

    public void setDateBlocked(Date dateBlocked) {
        this.dateBlocked = dateBlocked;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (blockedId != null ? blockedId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof BlockedFriends)) {
            return false;
        }
        BlockedFriends other = (BlockedFriends) object;
        if ((this.blockedId == null && other.blockedId != null) || (this.blockedId != null && !this.blockedId.equals(other.blockedId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "ghanaroutes.entities.BlockedFriends[ blockedId=" + blockedId + " ]";
    }
    
}
